import { axios } from '@/utils/request'

/**
 * 代金券管理
 */

export function selectPage (parameter) {
  return axios({
    url: '/shop/coupon/selectPage',
    method: 'post',
    params: parameter
  })
}

export function saveOrUpdate (parameter) {
  return axios({
    url: '/shop/coupon/saveOrUpdate',
    method: 'post',
    data: parameter
  })
}

export function updateStatus (id) {
  return axios({
    url: '/shop/coupon/' + id + '/updateStatus',
    method: 'get'
  })
}

export function selectAllByParentCode (parameter) {
  return axios({
    url: '/shop/coupon/selectAllByParentCode',
    method: 'get',
    params: parameter
  })
}

export function saveOrUpdate2 (parameter) {
  return axios({
    url: '/shop/coupon/saveOrUpdate2',
    method: 'post',
    data: parameter
  })
}

export function del (parameter) {
  return axios({
    url: '/shop/coupon/' + parameter + '/delete',
    method: 'get'
  })
}

export function useMerCoupon (parameter) {
  return axios({
    url: '/shop/coupon/useMerCoupon',
    method: 'get',
    params: parameter
  })
}

export function selectAllCoupon (parameter) {
  return axios({
    url: '/shop/coupon/selectAllCoupon',
    method: 'post',
    params: parameter
  })
}
